OPC Studio User's Guide and Reference
Examples - OPC Unified Architecture - Browsing forward references

.NET

// This example shows how to obtain nodes under a given node of the OPC-UA address space. 
// For each node, it displays its browse name and node ID.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

using System;
using System.Diagnostics;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace;
using OpcLabs.EasyOpc.UA.Navigation.Parsing;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples._EasyUAClient
{
    partial class Browse
    {
        public static void Main1()
        {
            UAEndpointDescriptor endpointDescriptor =
                "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";
            // or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
            // or "https://opcua.demo-this.com:51212/UA/SampleServer/"

            var browsePathParser = new UABrowsePathParser("http://test.org/UA/Data/");
            UANodeDescriptor nodeDescriptor = browsePathParser.Parse("[ObjectsFolder]/Data/Static/UserScalar");

            // Instantiate the client object
            var client = new EasyUAClient();

            // perform the operation
            UANodeElementCollection nodeElementCollection;
            try
            {
                nodeElementCollection = client.Browse(
                    endpointDescriptor, 
                    nodeDescriptor, 
                    UABrowseParameters.AllForwardReferences);
            }
            catch (UAException uaException)
            {
                Console.WriteLine($"*** Failure: {uaException.GetBaseException().Message}");
                return;
            }

            // Display results
            foreach (UANodeElement nodeElement in nodeElementCollection)
            {
                Debug.Assert(!(nodeElement is null));
                Console.WriteLine($"{nodeElement.BrowseName}: {nodeElement.NodeId}");
            }
        }

        // Example output:
        //
        //BooleanValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10384
        //SByteValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10385
        //ByteValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10386
        //Int16Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10387
        //UInt16Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10388
        //Int32Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10389
        //UInt32Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10390
        //Int64Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10391
        //UInt64Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10392
        //FloatValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10393
        //DoubleValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10394
        //StringValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10395
        //DateTimeValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10396
        //GuidValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10397
        //ByteStringValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10398
        //XmlElementValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10399
        //NodeIdValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10400
        //ExpandedNodeIdValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10401
        //QualifiedNameValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10402
        //LocalizedTextValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10403
        //StatusCodeValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10404
        //VariantValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10405
        //SimulationActive: nsu=http://test.org/UA/Data/ ;ns=2;i=10328
        //GenerateValues: nsu=http://test.org/UA/Data/ ;ns=2;i=10329
        //CycleComplete: nsu=http://test.org/UA/Data/ ;ns=2;i=10331
        //UserScalarValueObjectType: nsu=http://test.org/UA/Data/ ;ns=2;i=9921
    }
}
# This example shows how to obtain nodes under a given node of the OPC-UA address space. 
# For each node, it displays its browse name and node ID.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

#requires -Version 5.1
using namespace OpcLabs.EasyOpc.UA
using namespace OpcLabs.EasyOpc.UA.Navigation.Parsing;
using namespace OpcLabs.EasyOpc.UA.OperationModel

# The path below assumes that the current directory is [ProductDir]/Examples-NET/PowerShell/Windows .
Add-Type -Path "../../../Components/Opclabs.QuickOpc/net472/OpcLabs.EasyOpcUA.dll"
Add-Type -Path "../../../Components/Opclabs.QuickOpc/net472/OpcLabs.EasyOpcUAComponents.dll"

[UAEndpointDescriptor]$endpointDescriptor =
    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
# or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
# or "https://opcua.demo-this.com:51212/UA/SampleServer/"

$browsePathParser = New-Object UABrowsePathParser("http://test.org/UA/Data/")
$nodeDescriptor = $browsePathParser.Parse("[ObjectsFolder]/Data/Static/UserScalar")

# Instantiate the client object.
$client = New-Object EasyUAClient

# perform the operation
try {
$nodeElementCollection = [IEasyUAClientExtension]::Browse($client,
    $endpointDescriptor, 
    $nodeDescriptor, 
    [UABrowseParameters]::AllForwardReferences)
}
catch [UAException] {
    Write-Host "*** Failure: $($PSItem.Exception.GetBaseException().Message)"
    return
}

# Display results
foreach ($nodeElement in $nodeElementCollection) {
    Write-Host "$($nodeElement.BrowseName): $($nodeElement.NodeId)"
}


# Example output:
#
#BooleanValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10384
#SByteValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10385
#ByteValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10386
#Int16Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10387
#UInt16Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10388
#Int32Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10389
#UInt32Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10390
#Int64Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10391
#UInt64Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10392
#FloatValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10393
#DoubleValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10394
#StringValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10395
#DateTimeValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10396
#GuidValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10397
#ByteStringValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10398
#XmlElementValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10399
#NodeIdValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10400
#ExpandedNodeIdValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10401
#QualifiedNameValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10402
#LocalizedTextValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10403
#StatusCodeValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10404
#VariantValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10405
#SimulationActive: nsu=http://test.org/UA/Data/ ;ns=2;i=10328
#GenerateValues: nsu=http://test.org/UA/Data/ ;ns=2;i=10329
#CycleComplete: nsu=http://test.org/UA/Data/ ;ns=2;i=10331
#UserScalarValueObjectType: nsu=http://test.org/UA/Data/ ;ns=2;i=9921

# This example shows how to obtain nodes under a given node of the OPC-UA address space. 
# For each node, it displays its browse name and node ID.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from OpcLabs.EasyOpc.UA import *
from OpcLabs.EasyOpc.UA.Navigation.Parsing import *
from OpcLabs.EasyOpc.UA.OperationModel import *


endpointDescriptor = UAEndpointDescriptor('opc.tcp://opcua.demo-this.com:51210/UA/SampleServer')
# or 'http://opcua.demo-this.com:51211/UA/SampleServer' (currently not supported)
# or 'https://opcua.demo-this.com:51212/UA/SampleServer/'

browsePathParser = UABrowsePathParser('http://test.org/UA/Data/')
nodeDescriptor = UANodeDescriptor(browsePathParser.Parse('[ObjectsFolder]/Data/Static/UserScalar'))

# Instantiate the client object.
client = EasyUAClient()

# Perform the operation.
try:
    nodeElements = IEasyUAClientExtension.Browse(client,
         endpointDescriptor,
         nodeDescriptor,
         UABrowseParameters.AllForwardReferences)
except UAException as uaException:
    print('*** Failure: ' + uaException.GetBaseException().Message)
    exit()

# Display results.
for nodeElement in nodeElements:
    assert nodeElement is not None
    print(nodeElement.BrowseName, ': ', nodeElement.NodeId, sep='')
' This example shows how to obtain nodes under a given node of the OPC-UA address space. 
' For each node, it displays its browse name and node ID.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Imports OpcLabs.EasyOpc.UA
Imports OpcLabs.EasyOpc.UA.AddressSpace
Imports OpcLabs.EasyOpc.UA.Navigation.Parsing
Imports OpcLabs.EasyOpc.UA.OperationModel

Namespace _EasyUAClient
    Partial Friend Class Browse
        Public Shared Sub Main1()
            Dim endpointDescriptor As UAEndpointDescriptor =
                    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
            ' or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
            ' or "https://opcua.demo-this.com:51212/UA/SampleServer/"

            Dim browsePathParser As UABrowsePathParser = New UABrowsePathParser("http://test.org/UA/Data/")
            Dim nodeDescriptor As UANodeDescriptor = browsePathParser.Parse("[ObjectsFolder]/Data/Static/UserScalar")

            ' Instantiate the client object
            Dim client = New EasyUAClient()

            ' perform the operation
            Dim nodeElementCollection As UANodeElementCollection
            Try
                nodeElementCollection = client.Browse(
                    endpointDescriptor,
                    nodeDescriptor,
                    UABrowseParameters.AllForwardReferences)
            Catch uaException As UAException
                Console.WriteLine($"*** Failure: {uaException.GetBaseException().Message}")
                Exit Sub
            End Try

            ' Display results
            For Each nodeElement As UANodeElement In nodeElementCollection
                Debug.Assert(nodeElement IsNot Nothing)
                Console.WriteLine($"{nodeElement.BrowseName}: {nodeElement.NodeId}")
            Next nodeElement
        End Sub

        ' Example output
        '
        'BooleanValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10384
        'SByteValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10385
        'ByteValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10386
        'Int16Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10387
        'UInt16Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10388
        'Int32Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10389
        'UInt32Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10390
        'Int64Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10391
        'UInt64Value: nsu=http://test.org/UA/Data/ ;ns=2;i=10392
        'FloatValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10393
        'DoubleValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10394
        'StringValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10395
        'DateTimeValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10396
        'GuidValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10397
        'ByteStringValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10398
        'XmlElementValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10399
        'NodeIdValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10400
        'ExpandedNodeIdValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10401
        'QualifiedNameValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10402
        'LocalizedTextValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10403
        'StatusCodeValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10404
        'VariantValue: nsu=http://test.org/UA/Data/ ;ns=2;i=10405
        'SimulationActive: nsu=http://test.org/UA/Data/ ;ns=2;i=10328
        'GenerateValues: nsu=http://test.org/UA/Data/ ;ns=2;i=10329
        'CycleComplete: nsu=http://test.org/UA/Data/ ;ns=2;i=10331
        'UserScalarValueObjectType: nsu=http://test.org/UA/Data/ ;ns=2;i=9921
    End Class
End Namespace

COM

// This example shows how to obtain nodes under a given node of the OPC-UA address space.
// For each node, it displays its browse name and node ID.
//
// Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

#include "stdafx.h"    // Includes "QuickOpc.h", and other commonly used files
#include "Browse.h"

namespace _EasyUAClient
{
    void Browse::Main()
    {
        // Initialize the COM library
        CoInitializeEx(nullptr, COINIT_MULTITHREADED);
        {
            _UAEndpointDescriptorPtr EndpointDescriptorPtr(__uuidof(UAEndpointDescriptor));
            EndpointDescriptorPtr->UrlString = 
                //L"http://opcua.demo-this.com:51211/UA/SampleServer";
                L"opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";

            _UANodeDescriptorPtr NodeDescriptorPtr(__uuidof(UANodeDescriptor));
            _UABrowsePathParserPtr BrowsePathParserPtr(__uuidof(UABrowsePathParser));
            BrowsePathParserPtr->DefaultNamespaceUriString = L"http://test.org/UA/Data/";
            NodeDescriptorPtr->BrowsePath = BrowsePathParserPtr->Parse(L"[ObjectsFolder]/Data/Static/UserScalar");

            _UABrowseParametersPtr BrowseParametersPtr(__uuidof(UABrowseParameters));
            BrowseParametersPtr->StandardName = L"AllForwardReferences";

            // Instantiate the client object
            _EasyUAClientPtr ClientPtr(__uuidof(EasyUAClient));

            // Perform the operation
            _UANodeElementCollectionPtr NodeElementsPtr = ClientPtr->Browse(
                static_cast<IDispatch*>(EndpointDescriptorPtr), 
                static_cast<IDispatch*>(NodeDescriptorPtr), 
                static_cast<IDispatch*>(BrowseParametersPtr));
    
            // Display results
            IEnumVARIANTPtr EnumNodeElementPtr = NodeElementsPtr->GetEnumerator();
            _variant_t vNodeElement;
            while (EnumNodeElementPtr->Next(1, &vNodeElement, nullptr) == S_OK)
            {
                const _UANodeElementPtr NodeElementPtr(vNodeElement);
                _tprintf(_T("%s: "), (LPCTSTR)CW2CT(NodeElementPtr->BrowseName->ToString));
                _tprintf(_T("%s\n"), (LPCTSTR)CW2CT(NodeElementPtr->NodeId->ToString));
                vNodeElement.Clear();
            }
        }
         // Release all interface pointers BEFORE calling CoUninitialize()
        CoUninitialize();
    }
}
// This example shows how to obtain nodes under a given node of the OPC-UA
// address space. For each node, it displays its browse name and node ID.
//
// Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

class procedure Browse.Main;
var
  BrowseParameters: _UABrowseParameters;
  BrowsePathParser: _UABrowsePathParser;
  Client: EasyUAClient;
  Count: Cardinal;
  Element: OleVariant;
  EndpointDescriptor: _UAEndpointDescriptor;
  NodeDescriptor: _UANodeDescriptor;
  NodeElement: _UANodeElement;
  NodeElementEnumerator: IEnumVariant;
  NodeElements: _UANodeElementCollection;
begin
  EndpointDescriptor := CoUAEndpointDescriptor.Create;
  EndpointDescriptor.UrlString := 
    //'http://opcua.demo-this.com:51211/UA/SampleServer';
    'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer';

  NodeDescriptor := CoUANodeDescriptor.Create;
  BrowsePathParser := CoUABrowsePathParser.Create;
  BrowsePathParser.DefaultNamespaceUriString := 'http://test.org/UA/Data/';
  NodeDescriptor.BrowsePath := BrowsePathParser.Parse('[ObjectsFolder]/Data/Static/UserScalar');

  BrowseParameters := CoUABrowseParameters.Create;
  BrowseParameters.StandardName := 'AllForwardReferences';

  // Instantiate the client object
  Client := CoEasyUAClient.Create;

  NodeElements := Client.Browse(
    EndpointDescriptor,
    NodeDescriptor,
    BrowseParameters);

  NodeElementEnumerator := NodeElements.GetEnumerator;
  while (NodeElementEnumerator.Next(1, Element, Count) = S_OK) do
  begin
    NodeElement := IUnknown(Element) as _UANodeElement;
    WriteLn(NodeElement.BrowseName.ToString, ': ', NodeElement.NodeId.ToString);
  end;
end;
// This example shows how to obtain nodes under a given node of the OPC-UA
// address space. For each node, it displays its browse name and node ID.
//
// Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

class procedure Browse.Main;
var
  BrowseParameters: _UABrowseParameters;
  BrowsePathParser: _UABrowsePathParser;
  Client: OpcLabs_EasyOpcUA_TLB._EasyUAClient;
  Count: Cardinal;
  Element: OleVariant;
  EndpointDescriptor: _UAEndpointDescriptor;
  NodeDescriptor: _UANodeDescriptor;
  NodeElement: _UANodeElement;
  NodeElementEnumerator: IEnumVariant;
  NodeElements: _UANodeElementCollection;
begin
  EndpointDescriptor := CoUAEndpointDescriptor.Create;
  EndpointDescriptor.UrlString := 
    //'http://opcua.demo-this.com:51211/UA/SampleServer';
    //'https://opcua.demo-this.com:51212/UA/SampleServer/';
    'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer';

  NodeDescriptor := CoUANodeDescriptor.Create;
  BrowsePathParser := CoUABrowsePathParser.Create;
  BrowsePathParser.DefaultNamespaceUriString := 'http://test.org/UA/Data/';
  NodeDescriptor.BrowsePath := BrowsePathParser.Parse('[ObjectsFolder]/Data/Static/UserScalar');

  BrowseParameters := CoUABrowseParameters.Create;
  BrowseParameters.StandardName := 'AllForwardReferences';

  // Instantiate the client object
  Client := CoEasyUAClient.Create;

  try
    NodeElements := Client.Browse(
      EndpointDescriptor,
      NodeDescriptor,
      BrowseParameters);
  except
    on E: EOleException do
    begin
      WriteLn(Format('*** Failure: %s', [E.GetBaseException.Message]));
      Exit;
    end;
  end;

  NodeElementEnumerator := NodeElements.GetEnumerator;
  while (NodeElementEnumerator.Next(1, Element, Count) = S_OK) do
  begin
    NodeElement := IUnknown(Element) as _UANodeElement;
    WriteLn(NodeElement.BrowseName.ToString, ': ', NodeElement.NodeId.ToString);
  end;
end;
// This example shows how to obtain nodes under a given node of the OPC-UA address space. 
// For each node, it displays its browse name and node ID.
//
// Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

$EndpointDescriptor = new COM("OpcLabs.EasyOpc.UA.UAEndpointDescriptor");
$EndpointDescriptor->UrlString = 
    //"http://opcua.demo-this.com:51211/UA/SampleServer";
    //"https://opcua.demo-this.com:51212/UA/SampleServer/";
    "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";

$NodeDescriptor = new COM("OpcLabs.EasyOpc.UA.UANodeDescriptor");
$BrowsePathParser = new COM("OpcLabs.EasyOpc.UA.Navigation.Parsing.UABrowsePathParser");
$BrowsePathParser->DefaultNamespaceUriString = "http://test.org/UA/Data/";
$NodeDescriptor->BrowsePath = $BrowsePathParser->Parse("[ObjectsFolder]/Data/Static/UserScalar");

$BrowseParameters = new COM("OpcLabs.EasyOpc.UA.UABrowseParameters");
$BrowseParameters->StandardName = "AllForwardReferences";

// Instantiate the client object
$Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");

// Perform the operation
try
{
    $NodeElements = $Client->Browse($EndpointDescriptor, $NodeDescriptor, $BrowseParameters);
}
catch (com_exception $e)
{
    printf("*** Failure: %s\n", $e->getMessage());
    exit();
}

// Display results
foreach ($NodeElements as $NodeElement)
{
    printf("s: s\n", $NodeElement->BrowseName, $NodeElement->NodeId);
}
# This example shows how to obtain nodes under a given node of the OPC-UA address space. 
# For each node, it displays its browse name and node ID.
#
# The Python for Windows (pywin32) extensions package is needed. Install it using "pip install pypiwin32".
# CAUTION: We now recommend using Python.NET package instead. Full set of examples with Python.NET is available!
#
# Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
import win32com.client
from pywintypes import com_error

endpointDescriptor = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.UAEndpointDescriptor')
#endpointDescriptor.UrlString = 'http://opcua.demo-this.com:51211/UA/SampleServer'
endpointDescriptor.UrlString = 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'

nodeDescriptor = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.UANodeDescriptor')
browsePathParser = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.Navigation.Parsing.UABrowsePathParser')
browsePathParser.DefaultNamespaceUriString = 'http://test.org/UA/Data/'
nodeDescriptor.BrowsePath = browsePathParser.Parse('[ObjectsFolder]/Data/Static/UserScalar')

browseParameters = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.UABrowseParameters')
browseParameters.StandardName = 'AllForwardReferences'

# Instantiate the client object
client = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.EasyUAClient') 

# Perform the operation
try:
    nodeElements = client.Browse(endpointDescriptor, nodeDescriptor, browseParameters)
except com_error as e:
    print('*** Failure: ' + e.args[2][1] + ': ' + e.args[2][2])
    exit()

# Display results
for nodeElement in nodeElements:
    print(nodeElement.BrowseName, ': ', nodeElement.NodeId)
REM This example shows how to obtain nodes under a given node of the OPC-UA address space.
REM For each node, it displays its browse name and node ID.
REM
REM Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Public Sub Browse_Main_Command_Click()
    OutputText = ""

    Dim endpointDescriptor As New UAEndpointDescriptor
    endpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"

    Dim nodeDescriptor As New UANodeDescriptor
    Dim BrowsePathParser As New UABrowsePathParser
    BrowsePathParser.DefaultNamespaceUriString = "http://test.org/UA/Data/"
    Set nodeDescriptor.browsePath = BrowsePathParser.Parse("[ObjectsFolder]/Data/Static/UserScalar")

    Dim browseParameters As New UABrowseParameters
    browseParameters.StandardName = "AllForwardReferences"

    ' Instantiate the client object
    Dim Client As New EasyUAClient

    ' Perform the operation
    On Error Resume Next
    Dim NodeElements As UANodeElementCollection
    Set NodeElements = Client.Browse(endpointDescriptor, nodeDescriptor, browseParameters)
    If Err.Number <> 0 Then
        OutputText = OutputText & "*** Failure: " & Err.Source & ": " & Err.Description & vbCrLf
        Exit Sub
    End If
    On Error GoTo 0
    
    ' Display results
    Dim NodeElement: For Each NodeElement In NodeElements
        OutputText = OutputText & NodeElement.BrowseName & ": " & NodeElement.NodeId & vbCrLf
    Next
End Sub
Rem This example shows how to obtain nodes under a given node of the OPC-UA address space. 
Rem For each node, it displays its browse name and node ID.
Rem
Rem Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Option Explicit

Dim EndpointDescriptor: Set EndpointDescriptor = CreateObject("OpcLabs.EasyOpc.UA.UAEndpointDescriptor")
EndpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"

Dim NodeDescriptor: Set NodeDescriptor = CreateObject("OpcLabs.EasyOpc.UA.UANodeDescriptor")
Dim BrowsePathParser: Set BrowsePathParser = CreateObject("OpcLabs.EasyOpc.UA.Navigation.Parsing.UABrowsePathParser")
BrowsePathParser.DefaultNamespaceUriString = "http://test.org/UA/Data/"
NodeDescriptor.BrowsePath = BrowsePathParser.Parse("[ObjectsFolder]/Data/Static/UserScalar")

Dim BrowseParameters: Set BrowseParameters = CreateObject("OpcLabs.EasyOpc.UA.UABrowseParameters")
BrowseParameters.StandardName = "AllForwardReferences"

' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")

' Perform the operation
On Error Resume Next
Dim NodeElements: Set NodeElements = Client.Browse(EndpointDescriptor, NodeDescriptor, BrowseParameters)
If Err.Number <> 0 Then
    WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
    WScript.Quit
End If
On Error Goto 0

' Display results
Dim NodeElement: For Each NodeElement In NodeElements
    WScript.Echo NodeElement.BrowseName & ": " & NodeElement.NodeId
Next

See Also

Examples - OPC UA Alarms&Conditions

Conceptual